//search-sort.js  
//获取应用实例  
let app = getApp()
let httpUrl = app.globalData.httpUrl;
let thisErpId = app.globalData.thisErpId;
Page({
  data: {
    scrollHeight: 0,
    scrollTop: 0,
    // tab切换  
    currentTab: 0,
    searchBlok: 1,     //显示的搜索页块
    screeningBoo: false,    //筛选弹出块
    searchText: '',
    inputTxt: '',
    emptyTextShip: false,
    emptyTextProd: false,
    shipperData: [],   //重组后货主排序数据
    productData: [],   //重组产品排序数据
    shipperDataPor: [],   //货主排序数据
    productDataPor: [],   //产品排序数据
    SearchPrompData: [],   //模糊搜索数据
    searchHistoryData: [],     //搜索历史数据
    isLoadShipper: true,     //货主列表是否加载完毕
    isLoadProduct: true,     //产品列表是否加载完毕
    shipperPage: 1,         //货主列表下拉加载的页数
    productPage: 1,    //产品列表下拉加载的页数
    imgHttpUrl: 'http://www.stonhub.com/',
    // 选择器
    array: ['小于', '等于', '大于'],
    lengthIndex: 2,
    widthIndex: 2,
    heightIndex: 2,
    volumeIndex: 2,
    //筛选数据
    widthFilter: '-1',
    heightFilter: '-1',
    lengthFilter: '-1',
    volumeFilter: '-1',
    widthSum: '-1',
    heightSum: '-1',
    lengthSum: '-1',
    volumeSum: '-1',
    searchType: 'huangliao',
    searchPageType: '1',
    rightUnit: 'm³',
    sunUnit: '颗',
    textunit: '厚',
    isShipperLoad: true,        //为避免上拉一次触发多次上拉加载
    isProductLoad: true,
    screeningState: false,      //是否有点击筛选按钮
  },
  onLoad: function (options) {
    let that = this;
    let searchPageType = options.searchPageType || '1';
    let searchType = (searchPageType == '1') ? 'huangliao' : 'daban';
    let rightUnit = (searchPageType == '1') ? 'm³' : 'm²';
    let sunUnit = (searchPageType == '1') ? '颗' : '匝';
    let textunit = (searchPageType == '1') ? '高' : '厚';
    this.setData({
      searchPageType: searchPageType,
      searchType: searchType,
      rightUnit: rightUnit,
      sunUnit: sunUnit,
      textunit: textunit
    })
    /** 
     * 获取系统信息 
     */
    // wx.getSystemInfo({
    //   success: (res) => {
    //     let second_height = (res.windowWidth / 750) * 210;
    //     let scrollHeight = res.windowHeight - second_height;
    //     console.log(scrollHeight + '哦哦哦');
    //     console.log(second_height + '哦哦哦');
    //     this.setData({
    //       scrollHeight: scrollHeight,
    //       scrollTop: second_height
    //     })
    //     //判断手机操作系统
    //     // let system = res.system;
    //     // console.log(system)
    //     // if (system.indexOf('Android') > -1) {
    //     //   this.setData({
    //     //     isAndroid: 'android',
    //     //   })
    //     // }
    //   }
    // })
  },
  //每次打开页面重新获取
  // onReady: function (){

  // },
  onReady: function () {
    //获取搜索历史数据
    let searchHistory = wx.getStorageSync('searchHistoryData');
    this.setData({
      searchHistoryData: searchHistory || []
    })
    /** 
   * 获取系统信息 
   */
    wx.getSystemInfo({
      success: (res) => {
        if (res.windowWidth) {
          let second_height = (res.windowWidth / 750) * 210;
          let scrollHeight = res.windowHeight - second_height;
          console.log(scrollHeight + '啊啊啊');
          this.setData({
            scrollHeight: scrollHeight,
            scrollTop: second_height
          })
          //判断手机操作系统
          // let system = res.system;
          // console.log(system)
          // if (system.indexOf('Android') > -1) {
          //   this.setData({
          //     isAndroid: 'android',
          //   })
          // }
        }
      }
    })
  },
  /** 
 * 货主上拉加载 
 */
  onReachShipper: function (e) {
    let isShipperLoad = this.data.isShipperLoad;
    if (isShipperLoad) {
      this.setData({
        isShipperLoad: false,
      })
      let isLoadShipper = this.data.isLoadShipper;
      if (isLoadShipper == true) {
        this.setData({
          shipperPage: this.data.shipperPage + 1
        })
        this.getShipperData(this.data.searchText, 0);
      } else {
        wx.hideLoading();
        wx.showToast({
          title: '已经没有更多数据了!',
          icon: 'clear'
        })
      }

    }
  },
  /** 
 * 产品上拉加载 
 */
  onReachProduct: function (e) {
    let isProductLoad = this.data.isProductLoad;
    if (isProductLoad) {
      this.setData({
        isProductLoad: false,
      })
      let isLoadProduct = this.data.isLoadProduct;
      if (isLoadProduct == true) {
        this.setData({
          productPage: this.data.productPage + 1
        })
        this.getShipperData(this.data.searchText, 1);
      } else {
        wx.hideLoading();
        wx.showToast({
          title: '已经没有更多数据了!',
          icon: 'clear'
        })
      }
    }
  },
  /** 
   * 获取货主和产品排序 
   */
  getShipperData: function (searchText, showType) {
    let objData = this.data;
    const shipperPage = objData.shipperPage;
    const productPage = objData.productPage;
    let page = (showType == 0) ? shipperPage : productPage;
    // 筛选条件
    let volumeFilter = objData.volumeFilter;
    let volumeSum = objData.volumeSum;
    let widthFilter = objData.widthFilter;
    let heightFilter = objData.heightFilter;
    let lengthFilter = objData.lengthFilter;
    let widthSum = objData.widthSum;
    let heightSum = objData.heightSum;
    let lengthSum = objData.lengthSum;
    let screeningState = objData.screeningState;
    //当没有点击筛选按钮时所有条件为初始
    if (screeningState == false) {
      volumeFilter = '-1';
      volumeSum = '-1';
      widthFilter = '-1';
      heightFilter = '-1';
      lengthFilter = '-1';
      widthSum = '-1';
      heightSum = '-1';
      lengthSum = '-1';
    }

    let searchType = objData.searchType;
    if (searchType == 'daban') {
      volumeFilter = null;
      volumeSum = null;
    }
    if (wx.showLoading) {
      wx.showLoading({
        title: '正在加载...',
      })
    }
    wx.request({
      url: httpUrl + 'slsw/groupsearch.do',
      method: 'POST',
      data: `weChatKey=9237B361957490BA9644A710A5E3DD84&&Data={search_text:'${searchText}',width_filter:'${widthFilter}',
      height_filter:'${heightFilter}',length_filter:'${lengthFilter}',volume_filter:${volumeFilter},
      width:'${widthSum}',height:'${heightSum}',length:'${lengthSum}',volume:${volumeSum},
      show_type:'${showType}',is_refresh:${page == 1},page_num:${page},item_num:10,search_type:'${searchType}',erpId:'${thisErpId}'}`,
      header: {
        'content-type': 'application/x-www-form-urlencoded;charset=UTF-8"'
      },
      success: (res) => {
        if (showType == 0) {
          const shipperList = res.data.Data;
          // for (var i = 0; i < shipperList.length; i++){
          //   console.log(shipperList[i].imgUrl);
          // }
          let isLoadShipper = (shipperList.length == 10) ? true : false;
          let shipperListData = shipperPage == 1 ? shipperList : [...this.data.shipperDataPor, ...shipperList];
          let emptyText = (shipperPage == 1 && shipperList.length == 0) ? true : false;
          this.setData({
            shipperDataPor: shipperListData,
            shipperData: this.ShipperArrRegroup(shipperListData),
            isLoadShipper: isLoadShipper,
            emptyTextShip: emptyText,
            isShipperLoad: true,
          })
        } else if (showType == 1) {
          const productList = res.data.Data;
          let isLoadProduct = (productList.length == 10) ? true : false;
          let productListData = productPage == 1 ? productList : [...this.data.productDataPor, ...productList];
          let emptyText = (productPage == 1 && productList.length == 0) ? true : false;
          let productListDataTem = this.productArrRegroup(productListData)
          this.setData({
            productDataPor: productListData,
            productData: this.getSum(productListDataTem),
            isLoadProduct: isLoadProduct,
            emptyTextProd: emptyText,
            isProductLoad: true,
          })
        }
        wx.hideLoading();
      },
      fail: () => {
        wx.hideLoading();
        wx.showToast({
          title: '服务器开了个小差，请稍后再试!',
          icon: 'loading'
        })
        this.setData({
          isShipperLoad: true,
          isProductLoad: true,
        })
      }
    })
  },
  /** 
* 获取搜索提示列表 
*/
  getSearchPrompData: function (searchText) {
    wx.request({
      url: httpUrl + 'slsw/bmfuzzysearch.do',
      method: 'POST',
      data: `weChatKey=9237B361957490BA9644A710A5E3DD84&&Data={search_text:'${searchText}',erpId:'${thisErpId}'}`,
      header: {
        'content-type': 'application/x-www-form-urlencoded;charset=UTF-8"'
      },
      success: (res) => {
        this.setData({
          SearchPrompData: res.data.Data
        })
      }
    })
  },
  /** 
 * 货主数据数组查重后重组 
 */
  ShipperArrRegroup: function (arr) {
    let storData = [];
    //   let indexStorData = {};
    let stoneData = [];
    let indexStoneData = {};
    let res = [];
    for (let i = 0; i < arr.length; i++) {
      if (res.indexOf(arr[i].companyName) < 0) {
        res.push(arr[i].companyName);

        stoneData = [];
        //石材数据插入
        stoneData.push({
          imgUrl: arr[i].imgUrl,
          stoneId: arr[i].stoneId,
          stoneName: arr[i].stoneName,
          stoneNum: arr[i].stoneNum,
          stoneTotalMessage: arr[i].stoneTotalMessage,
          stoneWeight: arr[i].stoneWeight,
          totalNum: arr[i].totalNum,
        });
        //货主数据插入
        storData.push({
          stoneData: stoneData,
          companyId: arr[i].companyId,
          companyName: arr[i].companyName,
          pagerank: arr[i].pagerank,
          companyUrl: arr[i].companyUrl,
          phone: arr[i].phone
        });

      } else if (res.indexOf(arr[i].companyName) != -1) {
        //石材数据插入
        stoneData.push({
          imgUrl: arr[i].imgUrl,
          stoneId: arr[i].stoneId,
          stoneName: arr[i].stoneName,
          stoneNum: arr[i].stoneNum,
          stoneTotalMessage: arr[i].stoneTotalMessage,
          stoneWeight: arr[i].stoneWeight,
          totalNum: arr[i].totalNum,
        });
      }
    }
    return storData;
  },
  /** 
  * 产品数据数组查重后重组 
  */
  productArrRegroup: function (arr) {
    let storData = [];
    let indexStorData = {};
    let stoneData = [];
    let indexStoneData = {};
    let res = [];
    for (let i = 0; i < arr.length; i++) {
      if (res.indexOf(arr[i].stoneName) < 0) {
        res.push(arr[i].stoneName);

        indexStorData = {};   //避免数组或对象中残存上一个循环留下来的数据
        storData = [];

        //货主数据插入
        storData.push({
          companyId: arr[i].companyId,
          companyName: arr[i].companyName,
          pagerank: arr[i].pagerank,
          companyUrl: arr[i].companyUrl,
          phone: arr[i].phone,
          stoneNum: arr[i].stoneNum,
          stoneTotalMessage: arr[i].stoneTotalMessage,
          stoneWeight: arr[i].stoneWeight,
        });
        //石材数据插入
        stoneData.push({
          storData: storData,
          imgUrl: arr[i].imgUrl,
          stoneId: arr[i].stoneId,
          stoneName: arr[i].stoneName,
          totalNum: arr[i].stoneNum,
        });

      } else if (res.indexOf(arr[i].stoneName) > -1) {
        //货主数据插入
        storData.push({
          companyId: arr[i].companyId,
          companyName: arr[i].companyName,
          pagerank: arr[i].pagerank,
          companyUrl: arr[i].companyUrl,
          phone: arr[i].phone,
          stoneNum: arr[i].stoneNum,
          stoneTotalMessage: arr[i].stoneTotalMessage,
          stoneWeight: arr[i].stoneWeight,
        });
      }
    }
    return stoneData;
  },
  /** 
  * 数组去重
  */
  arrRecheck: function (arr) {
    let newArr = [];
    let res = [];
    for (let i = 0; i < arr.length; i++) {
      if (res.indexOf(arr[i].historyName) < 0) {
        res.push(arr[i].historyName);
        newArr.push({
          historyName: arr[i].historyName
        })
      }
    }
    return newArr
  },
  //参数相加
  getSum: function (arr) {
    let sum = 0;
    for (let i = 0; i < arr.length; i++) {
      for (let j = 0; j < (arr[i].storData).length; j++) {
        sum += parseInt(arr[i].storData[j].stoneNum);
      }
      arr[i].totalNum = sum;
      sum = 0;
    }
    return arr
  },
  /** 
  * 清空搜索结果储存数据
  */
  emptyStorgData: function () {
    this.setData({
      shipperDataPor: [],
      productDataPor: [],
      shipperData: [],
      productData: [],
      shipperPage: 1,
      productPage: 1,
    })
  },
  /** 
     * 滑动切换tab 
     */
  bindChange: function (e) {
    var that = this;
    that.setData({ currentTab: e.detail.current });

  },
  /** 
   * 点击tab切换 
   */
  swichNav: function (e) {
    var that = this;

    if (this.data.currentTab === e.target.dataset.current) {
      return false;
    } else {
      that.setData({
        currentTab: e.target.dataset.current
      })
    }
  },
  /** 
  * 删除搜索历史
  */
  seaHistorDel: function () {
    wx.removeStorageSync('searchHistoryData');
    this.setData({
      searchHistoryData: [],
    })
  },
  /** 
  * 储存搜索历史
  */
  setsearchStorage: function (searchHisText) {
    if (searchHisText) {
      let searchHistory = this.data.searchHistoryData;
      searchHistory.unshift({
        historyName: searchHisText
      });
      wx.setStorageSync('searchHistoryData', this.arrRecheck(searchHistory));
      searchHistory = this.arrRecheck(searchHistory);
      return searchHistory
    }
  },
  /** 
  * 点击搜索历史切换搜索结果页
  */
  searchResule: function (e) {
    this.emptyStorgData();
    this.emptyScreening();
    let searchHistory = this.setsearchStorage(e.currentTarget.dataset.text);
    this.setData({
      searchBlok: 3,
      inputTxt: e.currentTarget.dataset.text,
      searchText: e.currentTarget.dataset.text,
      searchHistoryData: searchHistory,
      screeningState: false,
    })
    this.getShipperData(e.currentTarget.dataset.text, 0);
    this.getShipperData(e.currentTarget.dataset.text, 1);
  },
  /** 
   * 点击input切换搜索历史页
   */
  searchHistory: function (e) {
    this.setData({
      searchText: e.detail.value
    })
    if (this.data.searchText == "") {
      this.setData({
        searchBlok: 1
      })
    }
  },
  /** 
   * 改变input内容时切换搜索提示页
   */
  searchPrompting: function (e) {
    this.setData({
      searchText: e.detail.value,
      inputTxt: e.detail.value
    })
    if (this.data.searchText != "") {
      this.setData({
        searchBlok: 2,
      })
      this.getSearchPrompData(e.detail.value);
    } else {
      this.setData({
        searchBlok: 1
      })
    }
  },
  /** 
   * 删除input的内容
   */
  delInput: function (e) {
    this.setData({
      inputTxt: '',
      searchText: '',
      searchBlok: 1
    })
  },
  /** 
   * 点击搜索按钮
   */
  searchBtn: function (e) {
    if (this.data.searchText) {
      let searchHistory = this.setsearchStorage(this.data.searchText);
      this.emptyStorgData();
      if (this.data.searchBlok != 3) {
        this.emptyScreening();
      }
      this.setData({
        searchBlok: 3,
        searchText: this.data.searchText,
        searchHistoryData: searchHistory,
        screeningState: false,
      });
      this.getShipperData(this.data.searchText, 0);
      this.getShipperData(this.data.searchText, 1);
    }
  },
  /** 
  * 长度选择器
  */
  lengthBindPicker: function (e) {
    this.setData({
      lengthIndex: e.detail.value,

      lengthFilter: e.detail.value
    })
  },
  //宽
  widthBindPicker: function (e) {
    this.setData({
      widthIndex: e.detail.value,

      widthFilter: e.detail.value
    })
  },
  //高
  heightBindPicker: function (e) {
    this.setData({
      heightIndex: e.detail.value,

      heightFilter: e.detail.value
    })
  },
  //体积
  volumeBindPicker: function (e) {
    this.setData({
      volumeIndex: e.detail.value,

      volumeFilter: e.detail.value
    })
  },
  /** 
  * 筛选窗口的input失焦时获取值
  */
  lenInputBlur: function (e) {
    let value = e.detail.value;
    let lengthFilter = this.data.lengthFilter;
    if (value) {
      this.setData({
        lengthSum: e.detail.value
      })
      //判断选择器是否为空
      if (lengthFilter == "-1") {
        this.setData({
          lengthFilter: '2'
        })
      }
    } else {
      this.setData({
        lengthSum: '-1',
      })
    }
  },
  widthInputBlur: function (e) {
    let value = e.detail.value;
    let widthFilter = this.data.widthFilter;
    if (value) {
      this.setData({
        widthSum: e.detail.value
      })
      //判断选择器是否为空
      if (widthFilter == "-1") {
        this.setData({
          widthFilter: '2'
        })
      }
    } else {
      this.setData({
        widthSum: '-1',
      })
    }
  },
  heiInputBlur: function (e) {
    let value = e.detail.value;
    let heightFilter = this.data.heightFilter;
    if (value) {
      this.setData({
        heightSum: e.detail.value
      })
      //判断选择器是否为空
      if (heightFilter == "-1") {
        this.setData({
          heightFilter: '2'
        })
      }
    } else {
      this.setData({
        heightSum: '-1',
      })
    }
  },
  volInputBlur: function (e) {
    // this.emptyStorgData();
    let value = e.detail.value;
    let volumeFilter = this.data.volumeFilter;
    if (value) {
      this.setData({
        volumeSum: e.detail.value
      })
      //判断选择器是否为空
      if (volumeFilter == "-1") {
        this.setData({
          volumeFilter: '2'
        })
      }
    } else {
      this.setData({
        volumeSum: '-1',
      })
    }
  },
  //关闭筛选
  screeningColse: function (e) {
    if (this.data.screeningState) {
      this.setData({
        screeningBoo: false,
      })
    } else {
      this.setData({
        screeningBoo: false,
        screeningState: false,
      })
    }

  },
  //确定筛选按钮
  screeningBtn: function (e) {
    let dataVal = e.detail.value;
    console.log(dataVal)
    let obj = this.data;
    let that = this;
    //避免失焦事件还没执行就开始提交
    setTimeout(function () {

    let lengthSum = dataVal.lenSum;
    if (lengthSum == '') {
      that.setData({
        lengthSum: '-1',
        lengthFilter: '-1',
        lengthIndex: 2,
      })
    } else {
      that.setData({
        lengthSum: lengthSum,
        lengthFilter: dataVal.lenPicker
      })
    }
    let widthSum = dataVal.widthSum;
    if (widthSum == '') {
      that.setData({
        widthSum: '-1',
        widthFilter: '-1',
        widthIndex: 2,
      })
    } else {
      that.setData({
        widthSum: widthSum,
        widthFilter: dataVal.widPicker
      })
    }
    let heightSum = dataVal.heiSum;
    console.log(heightSum)
    if (heightSum == '') {
      that.setData({
        heightSum: '-1',
        heightFilter: '-1',
        heightIndex: 2,
      })
    } else {
      that.setData({
        heightSum: heightSum,
        heightFilter: dataVal.heiPicker
      })
    }
    let volumeSum = dataVal.volSum;
    if (volumeSum == '') {
      that.setData({
        volumeSum: '-1',
        volumeFilter: '-1',
        volumeIndex: 2,
      })
    } else {
      that.setData({
        volumeSum: volumeSum,
        volumeFilter: dataVal.volPicker
      })
    }
    // 当没有筛选条件点确定时所有筛选条件为初始
    if (obj.lengthSum == '-1' && obj.widthSum == '-1' && obj.heightSum == '-1' && obj.volumeSum == '-1') {
      that.setData({
        screeningBoo: false,
        screeningState: false,
      })
      that.emptyScreening();
    } else {
      that.setData({
        screeningBoo: false,
        screeningState: true,
      })
    }
    that.getShipperData(that.data.searchText, 0);
    that.getShipperData(that.data.searchText, 1);
    }, 100)
  },
  // 打开筛选弹窗
  screenShowBtn: function (e) {
    this.setData({
      screeningBoo: true,
      // widthFilter: '2',
      // heightFilter: '2',
      // lengthFilter: '2',
      // volumeFilter: '2',
    })
  },
  //清除筛选状态
  emptyScreening: function () {
    this.setData({
      lengthIndex: 2,
      widthIndex: 2,
      heightIndex: 2,
      volumeIndex: 2,
      widthFilter: '-1',
      heightFilter: '-1',
      lengthFilter: '-1',
      volumeFilter: '-1',
      widthSum: '-1',
      heightSum: '-1',
      lengthSum: '-1',
      volumeSum: '-1',
    })
  },
  /** 
 * 列表页详情按钮 
 */
  stoneDetails: function (e) {
    let obj = this.data;
    let searchPageType = obj.searchPageType;
    let companyName = e.currentTarget.dataset.companyname;
    let stoneName = e.currentTarget.dataset.stonename;
    let stoneImg = e.currentTarget.dataset.img;
    let widthFilter = obj.widthFilter;
    let heightFilter = obj.heightFilter;
    let lengthFilter = obj.lengthFilter;
    let volumeFilter = obj.volumeFilter;
    let widthSum = obj.widthSum;
    let heightSum = obj.heightSum;
    let lengthSum = obj.lengthSum;
    let volumeSum = obj.volumeSum;

    let screeningState = obj.screeningState;
    //当没有点击筛选按钮时所有条件为初始
    if (screeningState == false) {
      volumeFilter = '-1';
      volumeSum = '-1';
      widthFilter = '-1';
      heightFilter = '-1';
      lengthFilter = '-1';
      widthSum = '-1';
      heightSum = '-1';
      lengthSum = '-1';
      this.setData({
        lengthIndex: 2,
        widthIndex: 2,
        heightIndex: 2,
        volumeIndex: 2,
      })
    }
    //跳转详情页时通过storage存储数据;
    let searchObj = {
      companyName: companyName,
      stoneName: stoneName,
      searchPageType: searchPageType,
      widthFilter: widthFilter,
      heightFilter: heightFilter,
      lengthFilter: lengthFilter,
      volumeFilter: volumeFilter,
      widthSum: widthSum,
      heightSum: heightSum,
      lengthSum: lengthSum,
      volumeSum: volumeSum,
      stoneImg: stoneImg,
    }
    wx.setStorageSync('searchObj', searchObj);
    wx.navigateTo({
      url: '../stone-details/stone-details'
    })
  },
  /**
 * 用户点击右上角分享
 */
  onShareAppMessage: function () {

  },
  //右滑关闭弹窗
  touchS: function (e) {
    if (e.touches.length == 1) {
      this.setData({
        startX: e.touches[0].clientX
      });
    }
  },
  // //触摸时触发，手指在屏幕上每移动一次，触发一次
  // touchM: function (e) {
  //   // var that = this
  //   // if (e.touches.length == 1) {
  //   //   //记录触摸点位置的X坐标
  //   //   var moveX = e.touches[0].clientX;
  //   //   var disX = moveX - that.data.startX;
  //   // }
  // },
  touchE: function (e) {
    let that = this
    if (e.changedTouches.length == 1) {
      let endX = e.changedTouches[0].clientX;
      let disX = endX - that.data.startX;
      if (disX > 100) {
        this.screeningColse();
      }
    }
  },
  // 货主排序图片预览
  shipPreimage: function (e) {
    let photos = e.currentTarget.dataset.urlarr;
    wx.previewImage({
      urls: photos // 需要预览的图片http链接列表  
    })
  },
  /** 
* 获取产品排序 
*/
  // getproductData(searchText) {
  //   const productPage = this.data.productPage;
  //   wx.request({
  //     url: httpUrl + 'slsw/groupsearch.do',
  //     method: 'POST',
  //     data: `weChatKey=9237B361957490BA9644A710A5E3DD84&&Data={search_text:'${searchText}',width_filter:null,
  //     height_filter:null,length_filter:null,volume_filter:null,width:null,height:null,length:null,
  //     volume:null,show_type:1,is_refresh:${productPage == 1},page_num:${productPage},item_num:10,search_type:'huangliao'}`,
  //     header: {
  //       'content-type': 'application/x-www-form-urlencoded;charset=UTF-8"'
  //     },
  //     success: (res) => {
  //       const productList = res.data.Data;
  //       let productListData = productPage == 1 ? productList : [...this.data.productDataPor, ...productList];
  //       this.setData({
  //         productDataPor: productListData,
  //         productData: this.productArrRegroup(productListData)
  //       })
  //       //console.log(this.arrRegroup(res.data.Data));
  //     }
  //   })
  // },
})

